<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <title><%= title %></title>
  <%- include common%>
</head>

<body>
  <%- include("head",{title:"index"}) %>
  <!-- <%- include head%> -->
  <div class="container-fluid">

    <h4 class="text-primary"><%- title %></h4>
    <%  if(username){ %>
    <div>
      <p>欢迎你：<b><%- username %></b></p>
      <p>登录时间 ： <span class="text-danger"> <%-  loginTime  %> </span></p>
      <p>当前时间 ： <span class="text-warning" id="nowTime"></span></p>
      <button type="button" class="btn btn-primary" onclick="location.href= '/movie'">查看电影</button>
      <button type="button" class="btn btn-danger" onclick="location.href= '/logout'">注销</button>

    </div>
    <%  }else{ %>
    <button type="button" class="btn btn-success" onclick="location.href='/login'">登录</button>
    <button type="button" class="btn btn-info" onclick="location.href='/register'">注册</button>

    <%  } %>
  </div>




  <%- include("foot") %>
</body>
<script>
  window.onload = function () {
    $("#nowTime").html(moment().format("YYYY-MM-DD HH:mm:ss"))
    var timer = setInterval(() => {
      $("#nowTime").html(moment().format("YYYY-MM-DD HH:mm:ss"))
    }, 1000)
  }
</script>

</html>